package rn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MysqlConnection implements IConnection {
	Connection con;
	public Connection establecerConexion() {
		//cargar el driver en memoria
		try {
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		}
		catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		//establecer conexion con la base de datos		
		try {
		    con=DriverManager.getConnection("jdbc:mysql://localhost/personas", "root","root");	
		}
		catch (SQLException e) {
			e.printStackTrace();
		}
		return con;
	}
}
